//流程模块【zbcg_expertapply.政府采购项目抽取专家申请表】下录入页面自定义js页面,初始函数
function initbodys(){
    loadProjectList();
}

function loadProjectList(){
    js.ajax(js.getajaxurl('getNowYearMergeProject','index','cg')
        ,{},function(s){
            var content = "<option value=''>-请选择-</option>";
            var obj = $("select[name='name']");
            $.each(s, function(i, field){
                content += "<option value='"+field.id+"' data-id='"+field.projectid+"'>"+field.name+"</option>";
            });
            if (obj.length>0) {
                obj.html(content);
            }
        },'get,json',false,'');
}

function oninputblur(na, zb, obj){
    var projectid = obj.value;
    if (na == 'name') {
        js.ajax(js.getajaxurl('getNowYearMergeProjectInfo','index','cg'),
            {
                "id":projectid
            }, function(s){
                var data = s;
                console.log(data.symbol);
                if(data.budget) {
                    $("input[name='budget']").val(data.budget);
                }
                if(data.symbol) {
                    $("input[name='approval_number']").val(data.symbol);
                }
                if(data.proclamationdate) {
                    $("input[name='tender_notice']").val(data.proclamationdate);
                }
                if(data.startbiddate) {
                    $("input[name='opentime']").val(data.startbiddate);
                }
            },'get,json',false,'');
    }
}

function changesubmit(d) {
    var area = regExp.filter('开、评标地点', d.area, 'chsDash');
    if(area.bool == false) return area.msg;
}